package com.yfjin.camera2;

import android.Manifest;
import android.app.Activity;
import android.content.Intent;
import android.media.MediaCodecList;
import android.os.Bundle;
import android.util.Log;

import java.util.ArrayList;
import java.util.List;

import androidx.annotation.Nullable;
import me.weyye.hipermission.PermissionItem;

public class SplashActivity extends Activity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        int count= MediaCodecList.getCodecCount();
        Log.i("123123","cout:"+count);

        List<PermissionItem> list = new ArrayList<>();
        list.add(new PermissionItem(Manifest.permission.WRITE_EXTERNAL_STORAGE));
        list.add(new PermissionItem(Manifest.permission.CAMERA));

        PermissionUtil.simpleAsk(this, list, new PermissionUtil.Callback() {
            @Override
            public void success() {
                startActivity(new Intent(SplashActivity.this, MainActivity.class));
                finish();
            }
        });

    }
}
